package com.gxa.jjty.cjr.controller;

import com.gxa.jjty.cjr.service.EvaluateConfigService;
import com.gxa.jjty.core.common.JsonResult;
import com.gxa.jjty.core.pojo.EvaluateConfig;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @ClassName EvaluateConfigController
 * @Author: ws
 * @date 2021/12/8 10:07
 */
@RestController
@RequestMapping("/evaluateConfig")
@Api(tags = "评价配置前台接口")
@Validated
public class EvaluateConfigController {

    @Autowired
    private EvaluateConfigService evaluateConfigService;

    @PostMapping("/getALl")
    @ApiOperation("获取所有已启动的评价配置")
    public Map getAll(){

        List<EvaluateConfig> allList = evaluateConfigService.getListByTrue();

        JsonResult jsonResult = new JsonResult();
        jsonResult.setCode("1");
        jsonResult.setData(allList);

        return jsonResult.getDataMap();
    }

}
